package com.d0316;

public class Calculator {
    public void div(int x,int y) throws Exception {
        if (y==0){
            throw new Exception("除数不能是0");
        }
        System.out.println(x/y);
    }
    public void callDiv(){
       /* try {
            div(6,0);
        } catch (Exception e) {
            e.printStackTrace();
        }*/

    }

    public static void main(String[] args) {
        Calculator calculator=new Calculator();
        calculator.callDiv();
    }
}
